package com.baosight.sczx.common.zm.cInterface.cc;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.spring.SpringApplicationContext;
import com.baosight.iplat4j.dao.Dao;
import com.baosight.sczx.zm.cc.domain.ZMCC5examineBusinessrate;

/**
 * 业务权重
 * <p>Title: _5ExamineBusinessRate.java</p>
 * <p>Description: </p>
 * <p>Copyright: Baosight Software LTD.co Copyright (c) 2002</p>
 * <p>Company: Baosight Software</p>
 * @author 严洪浩
 * @version 1.0
 * <pre>Histroy:
 *          2011-7-4 上午05:13:55  严洪浩  Create
 *</pre>
 */
public class _5ExamineBusinessRate {
	
	private static Dao dao = (Dao)SpringApplicationContext.getBean("dao");
	
	/**
	 * 业务权重Block
	 * <p>Function: getEngineering</p>
	 * <p>Description: </p>
	 * <p>return value:EiBlock</p>
	 * <p>throws Exception:</p>
	 * <p>History:
	 *    2011-6-28上午11:37:52 严洪浩
	 * </p>
	 *
	 */
	@SuppressWarnings({ "rawtypes"})
	public static EiBlock get5ExamineBusinessRate(String _blockID, boolean isAll) {
		EiBlock block = new EiBlock(_blockID);

		EiColumn eiColumn = new EiColumn("fdKeyId");
		eiColumn.setType("C");
		block.addMeta(eiColumn);

		eiColumn = new EiColumn("fdRateName");
		eiColumn.setType("C");
		block.addMeta(eiColumn);

		List<Map> _list = new ArrayList<Map>();
		if(isAll)  {
			Map<String, String> _map = new HashMap<String, String>();
			_map.put("fdKeyId", "");
			_map.put("fdRateName", "");
			_list.add(_map);
		}
		
		List _temp = dao.query("ZMCC5examineBusinessrate.query", null);
		for(int i = 0; i < _temp.size(); i++) {
			ZMCC5examineBusinessrate _businessRate = (ZMCC5examineBusinessrate)_temp.get(i);
			Map<String, String> _map = new HashMap<String, String>();
			_map.put("fdKeyId", _businessRate.getFdKeyId());
			_map.put("fdRateName", _businessRate.getFdRateName());
			_list.add(_map);
		}
		
		block.setRows(_list);
		return block;
	}
}
